Skip to content

cleanup(bigtable)!: remove experimental InstanceChannelAffinityOption#16213

Merged
scotthart merged 3 commits into
googleapis:mainfrom
scotthart:bigtable_relocate_instance_option
Jun 29, 2026
Merged

cleanup(bigtable)!: remove experimental InstanceChannelAffinityOption#16213
scotthart merged 3 commits into
googleapis:mainfrom
scotthart:bigtable_relocate_instance_option

Conversation

@scotthart

Copy link
Copy Markdown
Member

With the new MakeDataConnection(std::vector<InstanceResource>) now available, combining that with the experimental InstanceChannelAffinityOption is not intuitive. The experimental option has been removed as the new overload streamlines the instance specification.

@scotthart scotthart requested a review from a team as a code owner June 29, 2026 18:11
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label Jun 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the experimental InstanceChannelAffinityOption from the public API, moving it to the internal namespace bigtable_internal, and updates the documentation and tests accordingly. The feedback recommends removing a redundant test case that tests internal implementation details, and correcting a documentation comment in options.h to use the fully qualified name experimental::DynamicChannelPoolSizingPolicyOption.

Comment thread google/cloud/bigtable/data_connection_test.cc Outdated
Comment thread google/cloud/bigtable/options.h Outdated

@dbolduc dbolduc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a cleanup(bigtable)!: remove InstanceChannelAffinityOption

{InstanceResource(Project(project_id()), instance_id())},
std::move(options));
} else {
data_connection_ = MakeDataConnection(std::move(options));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this deprecated? Also, options is empty.

Maybe like:

auto instances = std::vector<InstanceResource>{};
if (GetEnv("GOOGLE_CLOUD_CPP_BIGTABLE_TESTING_CHANNEL_POOL")
          .value_or("") == "dynamic") {
  instances.push_back(InstanceResource(Project(project_id()), instance_id()));
}
data_connection_ = MakeDataConnection(std::move(instances));

Q: is there a downside to always supplying the InstanceResource, even when not using the dynamic channel pool? Then it is just:

    data_connection_ = MakeDataConnection(
        {InstanceResource(Project(project_id()), instance_id())});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the deprecated overload results in a single, static, round-robin channel pool. Using the new overload always uses DynamicChannelPools.

Using the deprecated method allows continued testing of the old channel pool.

namespace bigtable_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

struct InstanceChannelAffinityOption {

@dbolduc dbolduc Jun 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: internal options are a code smell. I am guessing we moved the option to internal to keep the refactor small.

In the long run, it seems ideal for the concrete DataConnectionImpl to hold these std::vector<InstanceResources> as a member.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Created #16216 to track.

Comment thread google/cloud/bigtable/data_connection.h
@scotthart scotthart force-pushed the bigtable_relocate_instance_option branch from 044d1ea to 239c565 Compare June 29, 2026 19:57
@scotthart scotthart changed the title impl(bigtable): use new MakeDataConnection in lieu of InstanceChannelAffinityOption cleanup(bigtable)!: remove experimental InstanceChannelAffinityOption Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.24%. Comparing base (11169c3) to head (239c565).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16213   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files        2265     2265           
  Lines      210221   210205   -16     
=======================================
- Hits       193910   193896   -14     
+ Misses      16311    16309    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart scotthart merged commit f1a8e57 into googleapis:main Jun 29, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants